<?php

  $WorkTable = &$_SQL_TABLE[$GlobPart];
  $WorkTableKeyFieldName = 'code';

  if($_REQUEST['mode'] == $GlobPart)
  {
    $PageTitle = '$language["admin"]["fileTypes"]." :: ".$Item["code"];';
    $CurrImageName = getFieldByEnother('code', $WorkTable, $WorkTableKeyFieldName, $_REQUEST[getKeyVarName()]);
  }
  else
  {
  	$PageTitle = '$language["admin"]["fileTypes"];';
  	$AloneMode = $GlobPart;
  }

   $_SQL_TABLE_FIELDS[$GlobPart] = array(

				'code' => array(
								'type' => 'input',
								'title' => $language['admin']['code'],
								'useInAddForm' => 'y',
								'addVariable' => $_POST['code'],
								'useInList' => $CONFIG['useInListSort'],
								//'noUseInEdit' => 'y',
								'required' => '\w{2,4}',
								'size' => 4,
								'maxlength' => '4',
								'unique' => 'y',
								'editFormOther' => 'disabled',
								),

				'mime' => array(
								'type' => 'input',
								'title' => $language['admin']['mimeType'],
								'useInAddForm' => 'y',
								'addVariable' => $_POST['mime'],
								'useInList' => $CONFIG['useInListSort'],
								'useInListEdit' => 'y',
								'maxlength' => '20',
								'required' => $CONFIG['AdminReqPatAll'],
								),

				'active' => array(
								'type' => 'select_link',
								'title' => $language['admin']['status'],
								'formid' => $CONFIG['activeFormName'],
								'addVariable' => $CONFIG['addMimeTypeActive'],
								'noUseInEdit' => 'y',
								'useInList' => $CONFIG['useInListSort'],
								'inListEdit' => 'select_link',
								'values' => array(
											'y' => array(
													'title' => $language['admin']['active'],
													'className' => 'active',
													'formFields' => array(
																	'act' => 'status',
																	'varvalue' => 'n',
																	'varname' => 'active',
																	getKeyVarName() => '{$Item.$WorkTableKeyFieldName}',
													),
											),
											'n' => array(
													'title' => $language['admin']['inactive'],
													'className' => 'inactive',
													'formFields' => array(
																	'act' => 'status',
																	'varvalue' => 'y',
																	'varname' => 'active',
																	getKeyVarName() => '{$Item.$WorkTableKeyFieldName}',
													),
											),
								),
				),

				'image_ico' => array(
								'type' => 'image',
								'old_filename' => $CurrImageName,
								'filetype' => $CONFIG['IconsFileType'],
								'filename' => ((!isBlank($_POST['code'])) ? $_POST['code'] : $CurrImageName),
								'dirname' => __CFG_PATH_IMAGES_ADMIN.$CONFIG['IconsImDir'],
								'docroot_dirname' => __CFG_PATH_IMAGES_URL.$CONFIG['IconsImDir'],
								'title' => $language['admin']['image'],
								'useInAddForm' => 'y',
								'noResize' => 'y',
								'textUnderField' => $language['admin']['size'].": ".$CONFIG['IconsFileSize'].", ".$language['admin']['fileType'].": ".$CONFIG['IconsFileType'],
								'size' => $CONFIG['IconsFileSize'],
				),


  );
  $_SQL_TABLE_EDIT_FORMS[$GlobPart] = array('active');



?>